package com.blackfish.common.untils;

import org.json.JSONObject;

import java.util.Map;

public class JsonUntil {

    private static String dumpJson(Map<String,Object> map) {
        JSONObject obj = new JSONObject();
        JSONObject item = new JSONObject();
        obj.put("all",item);
        for(String key:map.keySet()){
            item.put(key,map.get(key));
        }
        //调用toString()方法可直接将其内容打印出来
        System.out.println(obj.toString());
        return obj.getString("all");
    }

    public static JSONObject loadJson(String jsonStr) {
        JSONObject jsonObject = new JSONObject(jsonStr);
        return jsonObject;
    }
}
